function initMethodes(vm) {
  const methods = vm.$options.methods || {};
  //   console.log("methods ==> ", methods);
  // 挂载到 $vm 上 是他可以通过  this.xxx() 调用
  for (const key in methods) {
    proxyMethdosToVm(vm, methods, key);
  }
}

// 挂在方法到Vm实例上
function proxyMethdosToVm(target, sourceKey, key) {
  Object.defineProperty(target, key, {
    get() {
      return target[sourceKey][key];
    },
    set(val) {
      console.log("methdos is not set function");
    },
  });
}

export default initMethodes;
